package com.wrq.utils;

import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
        int [] arrs= {9,8,7,78,65,4,2};
        System.out.println(Arrays.toString(test(arrs)));
    }

    public static int [] test( int [] arr ){
        int temp;


            for (int i = 0; i <arr.length-1 ; i++) {
                for (int j=i; j>=0;j-- ){
                    int x = arr[j+1];
                    if (x<arr[j]){
                    temp=arr[j];
                    arr[j]=x;
                    arr[j+1]=temp;
                    }
                }
        }

        return arr;
    }
}
